package com.peng.config.minio;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class minioConfig {

    @Autowired
    private minioInfoConfig minioInfoConfig;

    //构建客户端连接
    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(minioInfoConfig.getEndpoint())
                .credentials(minioInfoConfig.getAccessKey(),
                        minioInfoConfig.getSecretKey())
                .build();
    }

}